<?php require_once('connections/con_gl.php'); ?>
<?php
cekAkses($_SESSION[akses],"DD-8-1");
mysql_select_db($database_con_gl, $con_gl);
$query_klas1 = "SELECT id, gudang FROM gl_gudang ORDER BY gudang ASC";
if(!strstr($_SESSION[akses],'A-1-4')) {
	$query_gudang .= " where id='$_SESSION[lokasi]'";
}
$klas1 = mysql_query($query_klas1, $con_gl) or die(mysql_error());
$row_klas1 = mysql_fetch_assoc($klas1);
$totalRows_klas1 = mysql_num_rows($klas1);

?>
<link href="ccss/ui.datepicker.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="js/ui.datepicker.js"></script>
<script type="text/javascript">
<!--
$(function()
      {
        $('.calendar').datepicker({
            appendText : "",
            dateFormat : 'yy/mm/dd'
          });
      });
	  
</script>
<script type="text/javascript" src="js/ajax_data.js"></script>
<script type="text/javascript">
$(document).ready(function() {

	$().ajaxStart(function() {
		$('#loading').show();
		$('#result').hide();
	}).ajaxStop(function() {
		$('#loading').hide();
		$('#result').fadeIn('slow');
	});

	$('#add').submit(function() {
		$.ajax({
			type: 'POST',
			url: $(this).attr('action'),
			data: $(this).serialize(),
			success: function(data) {
				$('#result').html(data);
			}
		})
		return false;
	});
  $('#result').click(function(){
  $(this).hide();
  });
})
</script>
<script>
function sendRespondCabang() {
	var ajaxRequest;  // The variable that makes Ajax possible!
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4){
			var ajaxDisplay = document.getElementById('divJenis');
			ajaxDisplay.innerHTML = ajaxRequest.responseText;
		}
		if (ajaxRequest.readyState == 3) {
			var ajaxDisplay = document.getElementById('divJenis');
			ajaxDisplay.innerHTML = "<img src='images/ajax-loader.gif' />";
		}
	}
	ajaxRequest.open("GET", "include/send_respondcabang.php", true);
	ajaxRequest.send(null);	
}
</script>

<div id="loading" style="display:none;"><img src="images/loading.gif" alt="loading..." /></div>
<div id="result" style="display:none;"></div>
<h1>Tambah Data Customer Corporate </h1>
<form action="proses/customercorporate.php?act=add" method="POST" name="add" id="add" >
  <table width="100%" border="0" align="center" cellpadding="5" cellspacing="0">
    
    <tr>
      <td align="right" bgcolor="#DDDDDD"><div align="left">Biodata Perusahaan </div>
      <label></label></td>
      <td align="right" bgcolor="#DDDDDD">&nbsp;</td>
      <td width="1%" bgcolor="#FFFFFF">&nbsp;</td>
      <td colspan="2" bgcolor="#DDDDDD"><div align="left">Status Customer </div></td>
      <td width="6%" bgcolor="#FFFFFF">&nbsp;</td>
    </tr>
    <tr valign="top">
      <td width="20%" align="right" bgcolor="#FFFFFF">Nama Perusahaan* : </td>
      <td width="30%" bgcolor="#FFFFFF"><label>
        <input name="nama" type="text" id="nama" size="37" maxlength="100" />
      </label></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td width="18%" bgcolor="#FFFFFF"><div align="right">Tanggal Daftar : </div></td>
      <td width="25%" bgcolor="#FFFFFF"><input name="tgldaftar" type="text" class="calendar" id="tgldaftar" value="<?php echo date("Y/m/d"); ?>" size="12" maxlength="15"/></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
    </tr>
    
    <tr valign="top">
      <td align="right" bgcolor="#FFFFFF">Alamat Perusahaan*  : </td>
      <td rowspan="2" bgcolor="#FFFFFF"><textarea name="alamat" cols="35" rows="2" id="alamat"></textarea>
        <input name="alamatx" type="hidden" id="alamatx" /></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF"><div align="right">Daftar di Area : </div></td>
      <td bgcolor="#FFFFFF"><input type="hidden" name="area" id="area" />
	  <input type="text" name="txtarea" id="txtarea" size="25" readonly style="background-color:#fff;border:1px solid #999; height:16px;" onClick="NewWindow('index.php?component=area&amp;task=list&amp;open=window','name','825','450','yes');return false" />
        <?php if(strstr($_SESSION['akses'],"PD-6-1")) { ?>
        <a href="index.php?component=area&amp;task=add&amp;open=window" onClick="NewWindow(this.href,'name','825','450','yes');return false"><img src="images/add_.png" hspace="2" border="0" style="position:absolute;" /></a>
        <?php } ?></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
    </tr>
    <tr valign="top">
      <td align="right" bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF"><div align="right">Daftar di cabang: </div></td>
      <td bgcolor="#FFFFFF"><input type="hidden" name="cabang" id="cabang" />
	  <input type="text" name="txtcabang" id="txtcabang" size="25" readonly style="background-color:#fff;border:1px solid #999; height:16px;" onClick="NewWindow('index.php?component=gudang&amp;task=list&amp;area='+document.getElementById('area').value+'&amp;open=window','name','825','450','yes');return false" />
          <?php if(strstr($_SESSION['akses'],"PD-7-1")) { ?> <a href="index.php?component=gudang&amp;task=add&amp;open=window" onClick="NewWindow(this.href,'name','825','450','yes');return false"><img src="images/add_.png" alt="Tambah data Cabang" hspace="2" border="0" style="position:absolute;"/></a>
          <?php } ?></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
    </tr>
    <tr valign="top">
      <td align="right" bgcolor="#FFFFFF">Telp Perusahaan* : </td>
      <td bgcolor="#FFFFFF"><input name="tlp" type="text" id="tlp" size="37" maxlength="100" /></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF"><div align="right">Status Customer : </div></td>
      <td bgcolor="#FFFFFF"><select name="statuscustomer" id="statuscustomer" style="width:210px;">
          <option value="AKTIF">AKTIF</option>
          <option value="TIDAK AKTIF">TIDAK AKTIF</option>
          <option value="BLACK LIST">BLACK LIST</option>
      </select></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
    </tr>
    <tr valign="top">
      <td align="right" bgcolor="#FFFFFF">Fax Perusahan : </td>
      <td bgcolor="#FFFFFF"><input name="fax" type="text" id="fax" size="37" maxlength="100" /></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF"><div align="right">Keterangan : </div></td>
      <td rowspan="2" bgcolor="#FFFFFF"><textarea name="keterangan" cols="35" rows="2" id="keterangan"></textarea>
          <input name="id3222" type="hidden" id="id3222" /></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
    </tr>
    <tr valign="top">
      <td align="right" bgcolor="#FFFFFF">email Perusahan : </td>
      <td bgcolor="#FFFFFF"><input name="email" type="text" id="email" size="18" maxlength="100" />
          <input name="id" type="hidden" id="id" />
        Format : abc@xx.com</td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr valign="top">
      <td align="right" bgcolor="#FFFFFF">NPWP : </td>
      <td bgcolor="#FFFFFF"><input name="npwp" type="text" id="npwp" size="37" maxlength="100" /></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td colspan="2" bgcolor="#DDDDDD">Data Pengurus Perusahaan </td>
      <td>&nbsp;</td>
    </tr>
    
    <tr>
      <td align="right" valign="top" bgcolor="#FFFFFF">Badan Usaha : </td>
      <td valign="top" bgcolor="#FFFFFF"><input name="badanusaha" type="text" id="badanusaha" size="37" maxlength="100" /></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td width="18%" valign="top" bgcolor="#FFFFFF"><div align="right">Nama : </div></td>
      <td width="25%" valign="top" bgcolor="#FFFFFF"><input name="nama2" type="text" id="nama2" size="37" maxlength="100" /></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
    </tr>
    <tr>
      <td align="right" bgcolor="#FFFFFF">Spesifikasi Usaha  : </td>
      <td bgcolor="#FFFFFF"><input name="spesifikasiusaha" type="text" id="spesifikasiusaha" size="37" maxlength="100" /></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td valign="top" bgcolor="#FFFFFF"><div align="right">Jabatan : </div></td>
      <td valign="top" bgcolor="#FFFFFF"><input name="jabatan2" type="text" id="jabatan2" size="37" maxlength="100" /></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
    </tr>
    <tr>
      <td align="left" bgcolor="#FFFFFF"><div align="right">Jumlah Karyawan : </div></td>
      <td bgcolor="#FFFFFF"><input name="jmlkaryawan" type="text" id="jmlkaryawan" size="37" maxlength="100" /></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td valign="top" bgcolor="#FFFFFF"><div align="right">Alamat : </div></td>
      <td rowspan="2" valign="top" bgcolor="#FFFFFF"><textarea name="alamat1" cols="35" rows="2" id="alamat1"></textarea>
          <input name="alamat1" type="hidden" id="alamat1" /></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
    </tr>
    
    
    <tr>
      <td align="left" bgcolor="#FFFFFF"><div align="right">Omset/Tahun Rp. :</div></td>
      <td bgcolor="#FFFFFF"><input name="omset" type="text" id="omset" size="37" maxlength="100" /></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td valign="top" bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
    </tr>
    <tr>
      <td valign="top" bgcolor="#DDDDDD">Data Referensi</td>
      <td bgcolor="#DDDDDD">&nbsp;</td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td valign="top"><div align="right">Telp/HP* :</div></td>
      <td valign="top"><input name="tlp2" type="text" id="tlp2" size="37" maxlength="100" /></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
    </tr>
    
    <tr>
      <td width="20%" valign="top" bgcolor="#FFFFFF"><div align="right">Nama  : </div></td>
      <td bgcolor="#FFFFFF"><input name="nama1" type="text" id="nama1" size="37" maxlength="100" /></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td valign="top" bgcolor="#DDDDDD">Data Penjamin </td>
      <td bgcolor="#DDDDDD">&nbsp;</td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
    </tr>
    
    <tr>
      <td valign="top" bgcolor="#FFFFFF"><div align="right">Jabatan : </div></td>
      <td bgcolor="#FFFFFF"><input name="jabatan1" type="text" id="jabatan1" size="37" maxlength="100" /></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td width="18%" valign="top" bgcolor="#FFFFFF"><div align="right">Nama  : </div></td>
      <td bgcolor="#FFFFFF"><input name="nama3" type="text" id="nama3" size="37" maxlength="100" /></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
    </tr>
    
    <tr>
      <td valign="top" bgcolor="#FFFFFF"><div align="right">Alamat Rumah: </div></td>
      <td rowspan="2" bgcolor="#FFFFFF"><textarea name="alamat3" cols="35" rows="2" id="alamat3"></textarea>
          <input name="alamat3" type="hidden" id="alamat3" /></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td valign="top" bgcolor="#FFFFFF"><div align="right">Jabatan : </div></td>
      <td bgcolor="#FFFFFF"><input name="jabatan3" type="text" id="jabatan3" size="37" maxlength="100" /></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
    </tr>
    <tr>
      <td valign="top" bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td valign="top" bgcolor="#FFFFFF"><div align="right">Alamat : </div></td>
      <td rowspan="2" bgcolor="#FFFFFF"><textarea name="alamat2" cols="35" rows="2" id="alamat2"></textarea>
          <input name="alamat2" type="hidden" id="alamat2" /></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
    </tr>
    
    
    
    <tr>
      <td valign="top" bgcolor="#FFFFFF"><div align="right">Telp/HP .: </div></td>
      <td bgcolor="#FFFFFF"><input name="tlp1" type="text" id="tlp1" size="37" maxlength="100" /></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td valign="top" bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
    </tr>
    
    <tr>
      <td align="left" bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td valign="top" bgcolor="#FFFFFF"><div align="right">Telp/HP .: </div></td>
      <td bgcolor="#FFFFFF"><input name="tlp3" type="text" id="tlp3" size="37" maxlength="100" /></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
    </tr>
    <tr>
      <td align="left" bgcolor="#FFFFFF"><em>*Harus diisi</em></td>
      <td bgcolor="#FFFFFF"><label>
        <input name="Save" type="submit" id="Save" value="Simpan" />
        </label>
          <label>
          <input type="button" name="Button" value="Batal" onClick="javascript:history.go(-1);">
        </label></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
    </tr>
  </table>
</form>
